<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use APP\Models\Student;
use Illuminate\Http\Request;
use Illuminate\Validation\ValidationException;

class StudentController extends Controller
{
    //
    public function index(Request $request)
    {
        $student=Student::query()
        ->orderBy('id','desc')
        ->paginate($request->input('per_page',10));

        return response()->json([
            'code'=>200,
            'msg'=>'success',
            'data'=>$student
        ]);
    }
}
